import {
    MenuFoldOutlined,
    MenuUnfoldOutlined,
    UploadOutlined,
    UserOutlined,
    VideoCameraOutlined,
} from '@ant-design/icons';

import Dashboard from "@/pages/dashboard/index"
import GoodList from "@/pages/good/goodList"
import GoodForm from "@/pages/good/goodForm"
import User from "@/pages/user/index"

import { FormattedMessage } from 'react-intl';

import Layout from "@/pages/layout/index.jsx";
import Login from "@/pages/login/index.jsx";

//静态路由 ，没有权限的路由
// const constantRoutes = [
//     { path: '/', element: <Layout />, children: [] },
//     { path: '/Login', element: <Login />, children: [] }
// ]

// 动态路由，有权限的路由
export const asyncRoutes = [
    {
        key: 1001,
        path: "/dashboard",
        label: <FormattedMessage id='menu.dashboard' />,
        icon: <MenuFoldOutlined />,
        element: <Dashboard />,
        meta: {
            roles: ['admin', 'editor']
        }
    },
    {
        key: 1002,
        icon: <VideoCameraOutlined />,
        label: <FormattedMessage id='menu.good' />,
        meta: {
            roles: ['admin', 'editor']
        },
        children: [
            {
                key: 100201,
                path: "/good/list",
                icon: null,
                label: <FormattedMessage id="menu.good.list" />,
                element: <GoodList />
            },
            {
                key: 100202,
                path: "/good/add",
                icon: null,
                label: <FormattedMessage id="menu.good.add" />,
                element: <GoodForm />,
                hidden: true
            },
            {
                key: 100203,
                path: "/good/edit",
                icon: null,
                label: <FormattedMessage id="menu.good.edit" />,
                element: <GoodForm />,
                hidden: true
            }
        ]
    },
    {
        key: 1003,
        path: "/user",
        element: <User />,
        icon: <UserOutlined />,
        label: <FormattedMessage id="menu.user" />,
        meta: {
            roles: ['admin', 'editor'],

            //admin看不到用户管理选项
            // roles: ['editor']
        }
    }
];
